package gof.com.yew.Strategy;

public class StrategyDemo {
	
	public static void main(String[] args) {
		Strategy s = new AddStrategy();
		Strategy s1 = new SubStrategy();
		Context c = new Context();
		c.addStrategy("add", s);
		c.addStrategy("sub", s1);
		int result = c.getResult("add", 100, 20);
		System.out.println("100 + 20 = "+result);
		 result = c.getResult("sub", 100, 20);
		System.out.println("100 - 20 = "+result);
	}

}
